import React from 'react'
import style from './index.less'
import { connect } from 'dva';
import { Row, Col } from 'antd'

/**
 * [ContentDisplay 查询结果]
 * 引用组件 
 * LatestNetValue 最新净值
 * NetValueEstimation 净值估算
 * NetValueTrend 净值走势
 * NetValuePerformance 净值表现
 * MonthlyReturn 月度回报
 */
import LatestNetValue from '../../components/LatestNetValue'
import NetValueEstimation from '../../components/NetValueEstimation'
import NetValueTrend from '../../components/NetValueTrend'
import NetValuePerformance from '../../components/NetValuePerformance'
import MonthlyReturn from '../../components/MonthlyReturn'
const ContentDisplay = ({
  timeRange,
  location,
  ...props,
}) => (
    <Row className='dataArea'>
      <Col>
        <LatestNetValue {...props} />
        <NetValueEstimation {...props} />
        <Row gutter={10}>
          <Col span={12}><NetValueTrend {...props} timeRange={timeRange} location={location} /></Col>
          <Col span={12}><NetValuePerformance {...props} /></Col>
        </Row>
        <MonthlyReturn {...props} />
      </Col>
    </Row>
  )


/**
 * [PortfolioPerformance 组合业绩]
 */
import { Tabtitle } from '../../../../components'
import { NoData } from '../../../../components'
const PortfolioPerformance = (props) => {
  const product = props.portList.length && props.lPortId && props.portList.find(item => item.productId == props.lPortId) || props.currentPort || ''
  return (
    <div className={style.root}>
      {
        (props.lPortId && props.cBenchCode)?<ContentDisplay {...props} productName={product && product.productName || ''} />:<NoData />
      }

    </div>
  );
}

export default connect()(PortfolioPerformance)